;(function(win){
				
	var $max = function(selector,context){
		return $max.fn.init(selector,context)
	}
	 /*
     * 创建一个私有class
     * @param {Object} els  arguments 所有参数组成的类数组
     */
	/*function $max(els){
		console.log(els)
		var elslen = els.length;
		var _this = this;
		_this.selector = els[0];
		_this.context = (els.length >= 2 && _this.isDom(els[1]))?els[1]:document;
		_this.elements = [];             //存放HTML元素
		_this.getDom(_this.selector,_this.context);
		_this.length = _this.elements.length;
		console.log(_this.isArray([1]))
	};*/
	$max.CONFIG = {
		
	};
	$max.fn = $max.prototype = {
		constructor:$max,
		selector: "",
		length:""
	}
	
	$max.fn.init = function(selector,context){
		console.log(1)
	}
	
	$max.methods = {
		getDom:function(selector,context){
			var _this = this;
			var selectorArr = selector.split(",");
			for(var i=0, len=selectorArr.length; i<len; i++) {
	            var element = selectorArr[i];
	            if(typeof element === 'string') {
	            	if(element.substring(0,1) == "#"){
	            		element = context.getElementById(element.substring(1));
	            		_this.elements.push(element);
	            	}else if(element.substring(0,1) == "."){
	            		element = context.getElementsByClassName(element.substring(1));
	            		_this.each(element,function(i,obj){
	            			_this.elements.push(obj);
	            		})
	            	}else{
	            		element = context.getElementsByTagName(element);
	            		_this.each(element,function(i,obj){
	            			_this.elements.push(obj);
	            		})
	            	}
	                /*element = document.getElementById(element);*/
	            }
	        }
		},
		
		each: function(collections,cb) {
			var collectionsLen = collections.length;
			for ( var i = 0;i < collectionsLen; i++ ) {
				cb&&cb.call(i,collections[i]);
			}
		},
        setStyle: function() {},
        show: function() {},
        addEvent: function() {},
        //首先要对HTMLElement进行类型检查，因为即使在支持HTMLElement
		//的浏览器中，类型却是有差别的，在Chrome,Opera中HTMLElement的
		//类型为function，此时就不能用它来判断了
        isDom:( typeof HTMLElement === 'object' ) ? function(obj){ return obj instanceof HTMLElement;} 
											      : function(obj){ return obj && typeof obj === 'object' && obj.nodeType === 1 && typeof obj.nodeName === 'string';},
		isArray:(Array.isArray) ? function(arr){ return Array.isArray(arr) ;}
								: function(arr){ return Object.prototype.toString().call(arr) === "[object Array]";}
	}
	
	win.$max = function(){
		return new $max(arguments);
	}
	
})(window);